<!doctype html>
<html>
<head>
	<meta charset="utf-8"/>
	<title>图片转文字</title>
	<style>
		form {
			margin: 0;
		}

		textarea {
			display: block;
		}
	</style>
	<link rel="stylesheet" href="../themes/default/default.css"/>
	<script charset="utf-8" src="../kindeditor-min.js"></script>
	<script charset="utf-8" src="../lang/zh_CN.js"></script>
	<script src="/js/jquery.min.js"></script>
	<script>
		var editor;
		KindEditor.ready(function (K) {
			editor = K.create('textarea[name="content"]', {
				allowFileManager: true
			});
			K('input[name=getHtml]').click(function (e) {
				let html = editor.html();
				$.ajax({
					type: "POST",
					contentType: "application/json ; charset=utf-8",
					dataType: "json",
					data: JSON.stringify({
						"html": html
					}),
					url: "/img2text/baidu",
					success: function (result) {
						$("#result").text(result)
					}
				});
			});
		});
	</script>
</head>
<body>
<form>
	<p>
		<input type="button" value="请将图片复制到下面的框框中"/>
	</p>
	<textarea name="content" style="width:1500px;height:400px;visibility:hidden;"></textarea>
	<p>
		<input type="button" name="getHtml" value="转换成文本"/>
	</p>
	<p>
		<textarea id="result" style="width:1500px;height:400px;font-size:22px"></textarea>
	</p>
</form>
</body>
</html>
